package com.ants.platform.weixin.model;


import com.alibaba.fastjson.JSON;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.Range;

import java.io.Serializable;

/**
 * Created by liushun on 2016/7/18.
 */
public class User implements Serializable {

    @NotBlank(message = "字段非null，且长度必须大于0")
    private String name;

    @Range(min = 1, max = 150, message = "字段必须在{min}到{max}的范围内")
    private int age;

    @NotBlank(message = "字段非null，且长度必须大于0")
    private String sex;

    public User() {

    }

    public User(String name, int age, String sex) {
        this.name = name;
        this.age = age;
        this.sex = sex;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String toJSONString() {
        return JSON.toJSONString(this);
    }

}
